package cc.linker.steplink.crm.merchant.dao;

import cc.linker.steplink.crm.merchant.pojo.*;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

public interface ShopGoodsMapper {

    Integer getGoodsCount(Map<String, Object> params);

    List<ShopGoods> getGoodsList(Map<String, Object> params);

    List<ShopGoods> getExportGoodsList(Map<String, Object> params);

    void insertGoods(Map map);

    void updateGoods(Map map);

    void delete(Long[] goodsIds);

    void insertGoodsSpec(GoodsSpec goodsSpecg);

    void insertSku(Sku sku);

    void deleteGoodsSpecs(Long goodsId);

    void deleteSkus(Long goodsId);

    Boolean updateStatus(Map<String, Object> params);

    void saveSpecKey(SpecKey specKey);

    Long getSpecKeyId(SpecKey specKey);

    void saveSpecValue(SpecValue specValue);

    Long getSpecValueId(SpecValue specValue);

    List<SpecKey> specKeyList(Map<String, Object> params);

    List<SpecValue> specValueList(Long specKeyId);

    ShopGoods getGoods(Long goodsId);

    List<GoodsSpec> getSpecByGoodsId(Long goodsId);

    List<Sku> getSkuByGoodsId(Long goodsId);

    void updateGoodsCount(Map<String, Object> order);

    void updateSkuCount(Map<String, Object> order);

    void updateGoodsBindArticle(Map<String, Object> params);

    void updateStatusByBelongId(Map<String, Object> param);

    void closeGoodsRebateRfByOrgId(@Param(value = "orgId") String orgId);

    void cleanGoodsBindArticle(Map<String, Object> params);

    void cleanGoodsBindArticleByGoodsIds(Long[] goodsIds);

    List<Map<String, Object>> getGoodsLabelsById(Long goodsId);

    void deleteGoodsLabels(Long goodsId);

    void updateGoodsLabels(@Param("goodsId") Long goodsId, @Param("split") String[] split);

    void updateGoodsBindArticleByMq(Map map);

    void deleteGoodsBindArticleByMq(Map map);

    /**
     * 封禁商品
     */
    void bannedGoodsByGoodsId(Map<String, Object> map);

    /**
     * 通过customerId查小b手机号
     */
    String getPhoneFromSalerByCustomerId(String customerId);

    /**
     * 联盟商城商品列表
     */
    List<Map<String, Object>> listAllAllianceGoods(Map<String, Object> params);
    /**
     * 联盟商城商品列表
     */
    List<Map<String, Object>> allianceShareList(Map<String, Object> params);

    /**
     * 添加/移除至(从)商城
     */
    void addToMallByGoodsId(Map<String, Object> params);

    /**
     * 设置推广/返润
     */
    void promotion(Map<String, Object> params);

    /**
     * 获取机构商品
     */
    List<Map<String, Object>> listProductPromotionByOrgId(Map<String, Object> params);

    /**
     * 设置共享和共享返润
     */
    void productShared(Map<String, Object> params);

    /**
     * 获取机构和共享商品的关联关系
     */
    Integer getAssociationByGoodsIdAndOrgId(Map<String, Object> params);

    /**
     * 关联机构和共享商品
     */
    void associationGoodsAndOrg(Map<String, Object> params);

    /**
     * 删除机构和共享商品的关联
     */
    void deleteAssociationByGoodsIdAndOrgId(Map<String, Object> params);

    /**
     * 机构信息列表
     */
    List<Map<String, Object>> getOrgInfoList();

    /**
     * 更新机构名称
     */
    void updateOrgInfo(Map<String, Object> map);

    /**
     * 查看选用
     */
    List<Map<String, Object>> getViewChoose(Map<String, Object> params);

    void mediaProductShared(Map<String, Object> params);

    /**
     * 删除商品列表中联盟商品的标识
     */
    void deleteOrgGoods(String goodsId);

    /**
     * 小b的我的商品列表
     */
    List<Map<String, Object>> listProductPromotionByCustomerId(Map<String, Object> params);

    /**
     * 批量选用
     */
    void mediaProductChoose(Map<String, Object> params);

    /**
     * 获取机构商品最大创建数量
     */
    Integer getGoodsLimitByOrgId(Map<String, Object> params);

    /**
     * 删除我的小店中的商品
     */
    void deleteAssociationForMyShopByGoodsId(Map<String, Object> params);

    /**
     * 获取商品状态（主要针对知识付费商品）
     */
    Map<String, Object> getGoodsStatusByGoodsId(Map<String, Object> params);

    /**
     * 根据机构id获取机构名
     */
    String getOrgNameByOrgId(String orgId);

    /**
     * 把只关联专栏售卖的内容下架 (通过专栏的goodsId)
     */
    void updateContentStatusByColumnGoodsId(Long goodsId);

    /**
     * 修改专栏下内容的purchase
     */
    void updatePurchaseByColumnGoodsId(Long goodsId);

    /**
     * 删除内容和专栏的关联
     */
    void deleteRelationColumnAndContentByColumnGoodsId(Long goodsId);

    /**
     * 删除内容和专栏的关联
     */
    void deleteRelationColumnAndContentByContentGoodsId(Long goodsId);

    /**
     * 修改内容purchase
     */
    void updatePurchaseByContentGoodsId(Long goodsId);

    void updateExercise(Long[] goodsIds);

    Long getGoodsIdByColumnId(long columnId);

    void updateMallsGoodsStatus(Long goodsId);

    void updateSalerGoodsStatus(Long goodsId);

    Integer checkGoodsStatusById(Long goodsId);

    Map<String, Object> getGoodsInfo(Long goodsId);

    void updateVip(Long[] goodsIds);

    List<ShopGoods> getGoodsListByCoupon(Map map);


    void updateIntegralGoods(Long[] goodsIds);

    List<Long> getGoodsIdsByTemplateId(@Param("templateId") String templateId);

    List<Map<String, Object>> getGoodsServiceList(Map<String, Object> param);

    void addGoodsService(Map<String, Object> param);

    void updateGoodsService(Map<String, Object> param);

    void delGoodsService(Map<String, Object> param);

    int getGoodsServiceBusiCount(String serviceId);

    String getServiceIdsByGoodsId(@Param("goodsId") Long goodsId);

    List<Map<String, Object>> getAllGoodsServiceList(Map<String, Object> param);

    Map<String, Object> getGoodsServiceInfo(Integer id);

    int getGoodsNameRepeatCount(Map<String, Object> param);

    Map<String, Object> getSecKill(Long goodsId);

    List<Map<String, Object>> getMyShareGoodsList(Map<String, Object> param);

    void saveSharing(Map<String, Object> param);

    Map<String, Object> getImportGoods(Map goodsNew);

    Integer updateImportGoods(Map<String, Object> goods);

    Integer updateImportGoodsSku(Map<String, Object> goods);

    Integer updateImportGoodsCount(Map<String, Object> goods);

    void insertImportGoods(Map<String, Object> goods);

    void insertImport(Map<String, Object> params);

    List<Map<String, Object>> getImportList(Map<String, Object> params);

    List<Map<String, Object>> getImportGoodsList(@Param("importId") String importId,@Param("status") Integer status);


    Long getImportGoodsCount(Map<String, Object> goods);

}
